package org.origin.ferret.system.model.dto.client;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 插入系统渠道数据-实体类
 *
 * @author ferret
 * @version 2024-05-08
 */
@Data
@Schema(description = "插入系统渠道数据-实体类")
public class SysClientInsertDto {

    @NotBlank(message = "终端编码不能为空")
    @Schema(description = "终端编码", requiredMode = Schema.RequiredMode.REQUIRED)
    private String clientId;

    @NotBlank(message = "终端秘钥不能为空")
    @Schema(description = "终端秘钥", requiredMode = Schema.RequiredMode.REQUIRED)
    private String clientSecret;

    @Schema(description = "过期时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date clientSecretExpiresAt;

    @NotBlank(message = "终端名称不能为空")
    @Schema(description = "终端名称", requiredMode = Schema.RequiredMode.REQUIRED)
    private String clientName;

    @Schema(description = "认证方式")
    private String clientAuthenticationMethods;

    @NotBlank(message = "授权模式不能为空")
    @Schema(description = "授权模式", requiredMode = Schema.RequiredMode.REQUIRED)
    private String authorizationGrantTypes;

    @Schema(description = "定向地址")
    private String redirectUris;

    @Schema(description = "登出地址")
    private String postLogoutRedirectUris;

    @NotBlank(message = "访问范围不能为空")
    @Schema(description = "访问范围", requiredMode = Schema.RequiredMode.REQUIRED)
    private String scopes;

    @Schema(description = "令牌有效时间（分钟）")
    private Integer liveTime;
}
